package com.zrgj.ctrl;

import com.zrgj.util.DBUtil;
import com.zrgj.vo.JsonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;

@RestController
public class TestDbUtilCtrl {

    @Resource(name = "imdb")
    private DBUtil dbUtil;

    @RequestMapping("/TestDbUtil")
    public JsonResult test() throws SQLException {
        JsonResult jr=new JsonResult(0,"ok");
        List list=dbUtil.query("select * from t_user");
        jr.setData(list);
        return jr;

    }

}
